.global _start

@ .global _bss_start
@ _bss_start:
@     .word __bss_start

@ .global _bss_end
@ _bss_end:
@     .word __bss_end


_start:
    mrs r0,cpsr             //读取cpsr状态寄存器
    bic r0,r0,#0x1f     //清除低五位
    orr r0,r0,#0x13     //设置为SVC特权模式
    msr cpsr,r0             //写回

@     ldr r0 , _bss_start
@     ldr r1 , _bss_end
@     mov r2 , #0

@ bss_loop:
@     stmia r0! , {r2}
@     cmp r0 , r1
@     ble bss_loop

    ldr sp,=0x80200000  //设置栈指针指向DDR的0x80000000到0x80200000区域，2MB大小
    b main
